plot_forecast
method plot_forecast(models=None, fh="test", X=None, target=0, plot_interval=True, title=None, legend="upper left", figsize=(900, 600), filename=None, display=True)[source]
Plot a time series with model forecasts.
This plot is only available for forecasting tasks.
| Parameters | models: int, str, Model, slice, sequence or None, default=None
Models to plot. If None, all models are selected. If no
models are selected, only the target column is plotted.
fh: int, str, range, sequence or ForecastingHorizon, default="test"
Forecast horizon for which to plot the predictions. If
string, choose from: "train", "test" or "holdout". Use a
sequence or add X: dataframe-like or None, default=None+ between options to select more than one.
Exogenous time series corresponding to fh. This parameter
is ignored if fh is a data set.
target: int or str, default=0
Target column to look at. Only for multivariate tasks.
plot_interval: bool, default=True
Whether to plot prediction intervals instead of the exact
prediction values. If True, the plotted estimators should
have a title: str, dict or None, default=Nonepredict_interval method.
Title for the plot.
legend: str, dict or None, default="upper left"
Legend for the plot. See the user guide for
an extended description of the choices.
figsize: tuple, default=(900, 600)
Figure's size in pixels, format as (x, y).
filename: str or None, default=None
Save the plot using this name. Use "auto" for automatic
naming. The type of the file depends on the provided name
(.html, .png, .pdf, etc...). If display: bool or None, default=Truefilename has no file type,
the plot is saved as html. If None, the plot is not saved.
Whether to render the plot. If None, it returns the figure.
|
| Returns | go.Figure or None
Plot object. Only returned if display=None.
|
See Also
Plot the lift curve.
Plot the precision-recall curve.
Plot the Receiver Operating Characteristics curve.
Example
>>> from atom import ATOMForecaster
>>> from sktime.datasets import load_airline
>>> y = load_airline()
>>> atom = ATOMForecaster(y, random_state=1)
>>> atom.plot_forecast()
>>> atom.run(
... models="arima",
... est_params={"order": (1, 1, 0), "seasonal_order": (0, 1, 0, 12)},
... )
>>> atom.plot_forecast()
>>> atom.plot_forecast(fh="train+test", plot_interval=False)
>>> # Forecast the next 4 years starting from the test set
>>> atom.plot_forecast(fh=range(1, 48))